<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
// 网站地址
String netPath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
%>
<!doctype html>
<head>
<meta charset="utf-8">
<title>栏目选择弹出层</title>
<link href="<c:url value="/stylesheets/common.css"/>" rel="stylesheet"
	type="text/css" />
<link href="<c:url value="/stylesheets/account.css"/>" rel="stylesheet"
	type="text/css" />
<script src="<c:url value="/javascripts/jquery.js"/>"></script>
<style>
.role_form {
	padding: 20px 0 0 10px;
}

.role_form .jsmc,.role_form textarea {
	width: 320px;
}

.linkhand {
	cursor: pointer;
}

.mouse_click {
	background-color: #888;
}

.mouse_cancle {
	background-color: white;
}
</style>
<script type="text/javascript" src="<%=basePath%>js/admin_compet.js"></script>
<script type="text/javascript">
	/**
	 提交之前的校验
	 */
	function validateSubmit(obj) {

	}


	/**
	 修改角色
	 */
	function saveColumns(obj) {
		var table = $(obj).parent().parent().children("table");
		var params = getParams(table);
		if (validateSubmit(table)) {
			$.ajax({
						url : "<%=basePath%>account/",
						type : "POST",
						contentType : "application/x-www-form-urlencoded; charset=utf-8",
						data : params,
						dataType : 'text',
						success : function(data) {
							var jsonobj = eval('(' + data + ')');
							if (jsonobj.state === '1') {
								parent.location.reload();
								parent.$.dialog.close();
							} else if (jsonobj.state === '0') {
								alert(jsonobj.result);
							}
						},
						error : function(XMLHttpRequest, textStatus,
								errorThrown) {
							alert("修改失败！");
						}
					});
		}
	}
	
	// 点击事件 
	$(function(){
		$("#getRelatedColumns").bind("click",function(){
			$("#relatedColumns").val(",");
			$.each($("#relatedCol li"),function(i){
				 if($(this).attr("class")=="mouse_click"){
					var strColumns = $("#relatedColumns").val() + $(this).attr("title") +",";
					$("#relatedColumns").val(strColumns);
				} 
			});
			parent.$("#strRelatedColumns").val($("#relatedColumns").val());
			// dialog 关闭
			parent.$.dialog.close();
			
		});
	});
</script>
</head>

<body>
	<br />
	<div>
		<ul
			style="cursor:pointer;height:300px;overflow:scroll;border:solid 1px #C9C9C9;"
			id="relatedCol">${sbRelatedColumns}
		</ul>
		<input type="hidden" name="relatedColumns" id="relatedColumns"></input>
		<div class="btnblock ">
			<input id="getRelatedColumns" type="button" value="保存" class="btngreen01 linkhand" />
		</div>
	</div>
</body>
</html>
